The present invention belongs to a technology field of a particular-region detection process for detecting a particular region such as a red eye present in a face region through image processing from an image photographed on a photographic film or an image photographed by a digital camera. In particular, the present invention relates to a method and apparatus for detecting a particular region which enable high speed detection of a red eye or the like from an image, and a program for implementing the same.
There has recently been put to practical use a digital photoprinter for photoelectrically reading an image recorded on a film, converting the read image into a digital signal, subsequently executing various image processing operations to convert the digital signal into image data for recording, executing photosensitive material exposure by a recording light modulated in accordance with the image data, and outputting the image as a print.
In the digital photoprinter, the image photographed on the film is photoelectrically read, the image is converted into the digital image data, and the image processing and the photosensitive material exposure are executed. Accordingly, prints can be created from not only the image photographed on the film but also the image (image data) photographed by the digital camera or the like.
With recent popularization of a personal computer (PC), a digital camera, and an inexpensive color printer such as an ink-jet printer, many users capture images photographed by the digital cameras in their PC's, carry out image processing, and output the images by the printers.
Additionally, there has recently been put to practical use a printer for directly reading image data from a storage medium storing an image photographed by a digital camera, executing predetermined image processing, and outputting a print (hard copy). Examples of the storage medium include a magneto-optical recording medium (MO or the like), a compact semiconductor memory medium (Smart Media™, Compact Flash™ or the like), a magnetic recording medium (flexible disk or the like), or an optical disk (CD, CD-R, or the like).
Incidentally, in an image that contains a person of a portrait or the like as an object, a most important factor to determine the image quality is a finished appearance of the person. Thus, a red-eye phenomenon is a serious problem in that eyes (pupils) of the person become red because of an influence of stroboscopic emission during photographing.
In the conventional photoprinter that directly executes exposure from the film, red-eye correction is very difficult. However, in the case of the digital image processing of the digital photoprinter or the like, red eyes are detected by image processing (image analysis), and the red eyes can be corrected by correcting luminance or chroma of the red-eye regions.
As a method of detecting red eyes from an image when the red-eye correction process is carried out, for example, there is a method of detecting a face from an image by image data analysis, and then detecting eyes or circular round regions constituting red eyes from the detected face. There have also been proposed various face detection methods used for the red-eye detection.
For example, JP 2000-137788 A discloses a method of improving accuracy of face detection as described below. A candidate region assumed to correspond to a face of a person is detected from an image, this candidate region is divided into a predetermined number of small blocks, a feature amount regarding frequency or amplitude of a change in density or luminance is obtained for each small block, and the feature amount is collated with a pattern indicating feature amount for each of small blocks which are obtained by dividing the precreated region corresponding to the face of the person into the predetermined number. Accordingly, it is possible to improve the accuracy of the face detection by evaluating the degree of assurance that the face candidate region is a face region.
As another example, JP 2000-148980 A discloses a method of improving accuracy of face detection. At first, a candidate region assumed to correspond to a face of a person is detected from an image, next a region assumed to be a body is set by using the face candidate region as a reference when a density of the face candidate region is within a predetermined range, and then the degree of the assurance of a detection result of the face candidate region is evaluated based on presence of a region in which a density difference between the set body region and the face candidate region is equal to/less than a predetermined value, or based on contrast of density or chroma between the face candidate region and the body candidate region. Accordingly, it is possible to improve the accuracy of the face detection.
Furthermore, JP2000-149018 A discloses a method of detecting candidate regions assumed to correspond to faces of persons from an image by various detection analyses, obtaining a degree of overlapping of one among the detected candidate regions with the other candidate region in the image, and evaluating a region of a higher degree of overlapping to be higher in the assurance of a face region. Accordingly, it is possible to improve the accuracy of the face detection.
The face detection requires accuracy, and various analyses are necessary. Thus, ordinarily, the face detection must be performed in high-resolution image data (so-called fine scan data in the case of image data read from a film, or photographed image data in the case of the digital camera) used for outputting a print or the like, and that causes a lot of time for detection.
Besides, there can be basically four directions of a face in a photographed image depending on disposal orientation of a camera (horizontally oriented and vertically oriented positions and the like) during photographing. Here, if face directions are different, arraying directions of an eye, a nose, and the like naturally vary in vertical and left-and-right directions of the image. Thus, to reliably detect the face, face detection must be performed in all the four directions in the image.
There are various face sizes in the image depending on object distances or the like. If face sizes are different in the image, a positional relation (distance) between an eye, a nose, and the like naturally varies in the image. Thus, to reliably detect the face, face detection must be performed corresponding to various face sizes.
As a result, the red-eye correction process takes much time because the red-eye detection, especially the face detection, is subjected to rate-controlling. For example, in the case of the digital photoprinter, high-quality images of no red eyes can be stably output, but the long process time is a major cause for a drop in productivity.